package com.wowangz.cms.common.utils;

import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

import com.wowangz.cms.common.select.BaseSelect;
import com.wowangz.cms.common.select.SelectFactory;

/**
 *
 * 用于系统的各种常量定义
 *
 * @author leiyang3
 *
 */
@SuppressWarnings({ "unchecked", "rawtypes" })
public class SysConstant {

	public static class IsSingle {
		public static final long DEFAULTTIME = 1; // 否
		public static final long SINGLE = 2; // 是
		public static final String DEFAULTTIME_NAME = "否"; // 否
		public static final String SINGLE_NAME = "是"; // 是
		public static final String getName(long lCode) {
			String strReturn = ""; // 初始化返回值
			switch ((int) lCode) {
			case (int) DEFAULTTIME:
				strReturn = DEFAULTTIME_NAME;
				break;
			case (int) SINGLE:
				strReturn = SINGLE_NAME;
				break;
			
			}
			return strReturn;
		}
	}
	
	public static class SystemResource {
		public static final long DEFAULTTIME = 1; // 运营平台
		public static final long STORE = 2; // 商户端
	}
	
	
	public static class LeaveMsgSaveTime {
		public static final long DEFAULTTIME = 24 * 60 * 60; // 保留1天(默认)
		public static final long ZERO = 0; // 0 不保留
		public static final long MIN_1 = 60; // 保留1分钟
		public static final long MIN_10 = 10 * 60; // 保留十分钟
		public static final long HOUR_1 = 60 * 60; // 保留1小时
		public static final long HOUR_3 = 3 * 60 * 60; // 保留3小时
		public static final long HOUR_12 = 12 * 60 * 60; // 保留12小时
		public static final long DAY_3 = 3 * 24 * 60 * 60;// 保留3天
		public static final long DAY_10 = 10 * 24 * 60 * 60;// 保留10天

		public static final long DIY = -1;

		private static String DEFAULTTIME_NAME = "默认(1)天";
		private static String ZERO_NAME = "0-不保留";
		private static String MIN_1_NAME = "1分钟";
		private static String MIN_10_NAME = "10分钟";
		private static String HOUR_1_NAME = "1小时";
		private static String HOUR_3_NAME = "3小时";
		private static String HOUR_12_NAME = "12小时";
		private static String DAY_3_NAME = "3天";
		private static String DAY_10_NAME = "10天";
		private static String DIY_NAME = "自定义";

		public static String getLeaveMsgSaveTimeModelJSONString(boolean all, boolean none) {
			BaseSelect baseSelect = SelectFactory.createBaseSelect();
			if (all) {
				baseSelect.addAllEmpty();
			}
			if (none) {
				baseSelect.addNoneEmpty();
			}
			baseSelect.addOption(DEFAULTTIME, DEFAULTTIME_NAME);
			baseSelect.addOption(ZERO, ZERO_NAME);
			baseSelect.addOption(MIN_1, MIN_1_NAME);
			baseSelect.addOption(MIN_10, MIN_10_NAME);
			baseSelect.addOption(HOUR_1, HOUR_1_NAME);
			baseSelect.addOption(HOUR_3, HOUR_3_NAME);
			baseSelect.addOption(HOUR_12, HOUR_12_NAME);
			baseSelect.addOption(DAY_3, DAY_3_NAME);
			baseSelect.addOption(DAY_10, DAY_10_NAME);
			baseSelect.addOption(DIY, DIY_NAME);
			return baseSelect.getJSONSelectInfo();
		}

		public static final String getName(long lCode) {
			String strReturn = ""; // 初始化返回值
			switch ((int) lCode) {
			case (int) DEFAULTTIME:
				strReturn = DEFAULTTIME_NAME;
				break;
			case (int) ZERO:
				strReturn = ZERO_NAME;
				break;
			case (int) MIN_1:
				strReturn = MIN_1_NAME;
				break;
			case (int) MIN_10:
				strReturn = MIN_10_NAME;
				break;
			case (int) HOUR_1:
				strReturn = HOUR_1_NAME;
				break;
			case (int) HOUR_3:
				strReturn = HOUR_3_NAME;
				break;
			case (int) HOUR_12:
				strReturn = HOUR_12_NAME;
				break;
			case (int) DAY_3:
				strReturn = DAY_3_NAME;
				break;
			case (int) DAY_10:
				strReturn = DAY_10_NAME;
				break;
			case (int) DIY:
				strReturn = DIY_NAME;
				break;
			}
			return strReturn;
		}
	}

	/**
	 * 发送时间
	 * 
	 * @author HUANGYUAN
	 *
	 */
	public static class Sendtime {
		public static final long IMMEDIATELY = 0;
		public static final long TIMING = 1;
		private static String IMMEDIATELY_NAME = "立即发送";
		private static String TIMING_NAME = "定时发送";

		public static String getSendtimeModelJSONString(boolean all, boolean none) {
			BaseSelect baseSelect = SelectFactory.createBaseSelect();
			if (all) {
				baseSelect.addAllEmpty();
			}
			if (none) {
				baseSelect.addNoneEmpty();
			}
			baseSelect.addOption(IMMEDIATELY, IMMEDIATELY_NAME);
			baseSelect.addOption(TIMING, TIMING_NAME);
			return baseSelect.getJSONSelectInfo();
		}

		public static final String getName(long lCode) {
			String strReturn = ""; // 初始化返回值
			switch ((int) lCode) {
			case (int) IMMEDIATELY:
				strReturn = IMMEDIATELY_NAME;
				break;
			case (int) TIMING:
				strReturn = TIMING_NAME;
				break;
			}
			return strReturn;
		}

	}

	/**
	 * 广播所有人
	 * 
	 * @author HUANGYUAN
	 *
	 */
	public static class BoradAllperson {
		public static final long ALL_PERSON = 0;
		public static final long DIY = 1;

		private static String ALL_PERSON_NAME = "所有人";
		private static String DIY_NAME = "自定义";

		public static String getBoradAllpersonModelJSONString(boolean all, boolean none) {
			BaseSelect baseSelect = SelectFactory.createBaseSelect();
			if (all) {
				baseSelect.addAllEmpty();
			}
			if (none) {
				baseSelect.addNoneEmpty();
			}
			baseSelect.addOption(ALL_PERSON, ALL_PERSON_NAME);
			baseSelect.addOption(DIY, DIY_NAME);
			return baseSelect.getJSONSelectInfo();
		}

		public static final String getName(long lCode) {
			String strReturn = ""; // 初始化返回值
			switch ((int) lCode) {
			case (int) ALL_PERSON:
				strReturn = ALL_PERSON_NAME;
				break;
			case (int) DIY:
				strReturn = DIY_NAME;
				break;
			}
			return strReturn;
		}
	}

	/**
	 * 与岗位的关联状态
	 *
	 * @author huangyuan
	 *
	 */
	public static class Relevance {
		public static final long CHECKED = 2; // 已复核
		private static final String CHECKED_NAME = "已复核";
		public static final long NOTCHECK = 1; // 未复核
		private static final String NOTCHECK_NAME = "已保存";
		public static final long NOTRELEVANCE = 3;// 未关联
		private static final String NOTRELEVANCE_NAME = "未关联";

		public static final String getName(long lCode) {
			String strReturn = ""; // 初始化返回值
			switch ((int) lCode) {
			case (int) CHECKED:
				strReturn = CHECKED_NAME;
				break;
			case (int) NOTCHECK:
				strReturn = NOTCHECK_NAME;
				break;
			case (int) NOTRELEVANCE:
				strReturn = NOTRELEVANCE_NAME;
				break;
			}
			return strReturn;
		}

		public static String getUserCheckModelJSONString(boolean all, boolean none) {
			BaseSelect baseSelect = SelectFactory.createBaseSelect();
			if (all) {
				baseSelect.addAllEmpty();
			}
			if (none) {
				baseSelect.addNoneEmpty();
			}
			baseSelect.addOption(NOTRELEVANCE, NOTRELEVANCE_NAME);
			baseSelect.addOption(CHECKED, CHECKED_NAME);
			baseSelect.addOption(NOTCHECK, NOTCHECK_NAME);
			return baseSelect.getJSONSelectInfo();
		}
	}

	public static class FileType {
		public static final Integer IMAGE = 1;
		public static final Integer OTHER = 2;
	}

	/**
	 * 申请类型
	 *
	 * @author issuser
	 *
	 */
	public static class ApplyType {
		public static final long CHANGECCOUNT = 2;

		public static final long CLOSECCOUNT = 3;

		public static final long OPENACCOUNT = 1;

		public static final String getName(long lCode) {
			String strReturn = ""; // 初始化返回值
			switch ((int) lCode) {
			case (int) OPENACCOUNT:
				strReturn = "开通申请";
				break;
			case (int) CHANGECCOUNT:
				strReturn = "变更申请";
				break;
			case (int) CLOSECCOUNT:
				strReturn = "销户申请";
				break;
			}
			return strReturn;
		}
	}

	/**
	 *
	 * @描述：是否密码过期或者快过期提示
	 * @author HUANGYUAN
	 * @TIME:2015年8月31日 上午9:30:44
	 */
	public static class Boolean {
		public static final Long FALSE = 0l;
		public static final Long TRUE = 1l;
	}

	/**
	 * 收费管理
	 *
	 * @author huangyuan
	 *
	 */
	@SuppressWarnings("unused")
	public static class ChargeManage {
		public static final long CIRCLE = 2;
		private static final String CIRCLE_NAME = "周期";

		public static final long MONTH = 4;
		private static final String MONTH_NAME = "月";

		public static final long TRADE = 1;
		private static final String TRADE_NAME = "交易";

		public static final long TRADESUM = 3;
		private static final String TRADESUM_NAME = "交易笔数";
	}

	/**
	 * 缴费状态
	 *
	 * @author issuser
	 *
	 */
	public static class ChargeStatus {
		public static final long NO = 2;
		public static final long YES = 1;

		public static final String getName(long lCode) {
			String strReturn = ""; // 初始化返回值
			switch ((int) lCode) {
			case (int) YES:
				strReturn = "已缴";
				break;
			case (int) NO:
				strReturn = "未缴";
				break;
			}
			return strReturn;
		}
	}

	public static class CheckStatus {
		public static final long CHECKED = 2; // 已复核

		private static final String NAME_CHECKED = "已复核";

		private static final String NAME_SAVE = "已保存";

		public static final long SAVE = 1; // 保存

		public static String getModelJSONString(boolean all, boolean none) {
			BaseSelect baseSelect = SelectFactory.createBaseSelect();
			if (all) {
				baseSelect.addAllEmpty();
			}
			if (none) {
				baseSelect.addNoneEmpty();
			}
			baseSelect.addOption(SAVE, NAME_SAVE);
			baseSelect.addOption(CHECKED, NAME_CHECKED);
			return baseSelect.getJSONSelectInfo();
		}

		public static final String getName(long lCode) {
			String strReturn = ""; // 初始化返回值
			switch ((int) lCode) {
			case (int) SAVE:
				strReturn = "已保存";
				break;
			case (int) CHECKED:
				strReturn = "已复核";
				break;
			}
			return strReturn;
		}
	}

	/**
	 * 审核状态
	 *
	 * @author cakohy
	 *
	 */
	public static class CommonApproveStatus {
		public static final long OK = 4; // 通过
		public static final long REFUSED = 3; // 拒绝
		public static final long SAVED = 1; // 保存
		public static final long SUBMITTED = 2; // 提交

		public static String getMode1JSONString(boolean all, boolean none) {
			BaseSelect baseSelect = SelectFactory.createBaseSelect();
			if (all) {
				baseSelect.addAllEmpty();
			}
			if (none) {
				baseSelect.addNoneEmpty();
			}
			baseSelect.addOption(CommonApproveStatus.SAVED,
					CommonApproveStatus.getStateName(CommonApproveStatus.SAVED));
			baseSelect.addOption(CommonApproveStatus.SUBMITTED,
					CommonApproveStatus.getStateName(CommonApproveStatus.SUBMITTED));
			baseSelect.addOption(CommonApproveStatus.REFUSED,
					CommonApproveStatus.getStateName(CommonApproveStatus.REFUSED));
			baseSelect.addOption(CommonApproveStatus.OK, CommonApproveStatus.getStateName(CommonApproveStatus.OK));
			return baseSelect.getJSONSelectInfo();
		}

		public static String getStateName(long code) {
			String name = "";
			switch (Integer.parseInt(String.valueOf(code))) {
			case 1:

				name = "保存";
				break;
			case 2:

				name = "提交";
				break;
			case 3:
				// 拒绝
				name = "拒绝";

				break;
			case 4:
				// 通过
				name = "通过";

				break;
			default:
				break;
			}
			return name;
		}
	}

	/**
	 * 通用使用状态
	 *
	 * @author
	 *
	 */
	public static class CommonUsedStatus {

		public static final String NAME_SAVE = "启用";
		public static final String NAME_VALID = "停用";

		public static final long START = 1l; // 启用
		public static final long STOP = 2l; // 停用

		public static String getALLStatus() {
			BaseSelect baseSelect = SelectFactory.createBaseSelect();
			baseSelect.addAll();
			baseSelect.addOption(START, NAME_SAVE);
			baseSelect.addOption(STOP, NAME_VALID);
			return baseSelect.getJSONSelectInfo();
		}

		public static String getMode1JSONString(boolean all, boolean none) {
			BaseSelect baseSelect = SelectFactory.createBaseSelect();
			if (all) {
				baseSelect.addAllEmpty();
			}
			if (none) {
				baseSelect.addNoneEmpty();
			}
			baseSelect.addOption(START, NAME_SAVE);
			baseSelect.addOption(STOP, NAME_VALID);
			return baseSelect.getJSONSelectInfo();
		}

		public static final String getName(long lCode) {

			String strReturn = ""; // 初始化返回值
			switch ((int) lCode) {
			case (int) START:
				strReturn = NAME_SAVE;
				break;
			case (int) STOP:
				strReturn = NAME_VALID;
				break;
			}
			return strReturn;
		}
	}

	/**
	 * 数据状态
	 *
	 * @author issuser
	 *
	 */
	public static class DataStatus {
		public static final long CHECKED = 2; // 已复核

		public static final long INSERT = 1; // 新增

		@SuppressWarnings("unused")
		private static final String NAME_CHECKED = "已复核";

		@SuppressWarnings("unused")
		private static final String NAME_INSERT = "新增";

		public static final String getName(long lCode) {
			String strReturn = ""; // 初始化返回值
			switch ((int) lCode) {
			case (int) INSERT:
				strReturn = "新增";
				break;
			case (int) CHECKED:
				strReturn = "已复核";
				break;
			}
			return strReturn;
		}
	}

	public static class Dbtype {

		public static final long DB_COUNT = 100; // 数据库生成数量

		public static final String DB_PREFIX = "db"; // 数据库前缀

	}

	// 加密密钥文件
	public static class DESKEY {
		public static final String DESKEY = "72l_tmiys0xbbduzvkq_1ez3";
	}

	/**
	 * 栏目是否显示
	 * 
	 * @author HUANGYUAN
	 *
	 */
	public static class Display {
		/*
		 * 不显示
		 */
		public static final long NO = 2l;
		/*
		 * 显示
		 */
		public static final long YES = 1l;

		public static String getMode1JSONString(boolean all, boolean none) {
			BaseSelect baseSelect = SelectFactory.createBaseSelect();
			if (all) {
				baseSelect.addAllEmpty();
			}
			if (none) {
				baseSelect.addNoneEmpty();
			}
			baseSelect.addOption(YES, "显示");
			baseSelect.addOption(NO, "不显示");
			return baseSelect.getJSONSelectInfo();
		}

		public static String getName(long lCode) {
			int code = (int) lCode;
			String name = "";
			switch (code) {
			case (int) YES:
				name = "显示";
				break;
			case (int) NO:
				name = "不显示";
				break;
			}
			return name;
		}
	}

	/*
	 * 系统自动任务运行状态(系统设置-自动任务设置模块，作为运行状态EXECUTESTATUS用)
	 */
	public static class ExecuteStatus {

		public static final long RUN = 2l; // 运行中

		public static final long STOP = 1l; // 未运行

		public static final String getName(long lCode) {

			String strReturn = ""; // 初始化返回值
			switch ((int) lCode) {
			case (int) RUN:
				strReturn = "运行中";
				break;
			case (int) STOP:
				strReturn = "未运行";
				break;
			}
			return strReturn;
		}

	}

	/**
	 * 根据Key得到对应的name名
	 *
	 * @author kaixia
	 *
	 */
	public static class getValueNameByKey {
		public static String getValueNameByKey(String constantName, String key) {
			constantName = SysConstant.class.getName() + "$" + constantName;
			String name = "";
			try {
				Class constantClass = Class.forName(constantName);
				Object[] args = new Object[1];
				Field[] field = constantClass.getDeclaredFields();
				Method method = null;
				if (field.length > 0) {
					// 确认第一个变量的值的类型即可
					String typeName = field[0].getType().getName();
					if (typeName.equals("long") || typeName.equals("int")) {
						if (key == null || key.trim().length() == 0) {
							args[0] = -1l;
						} else {
							args[0] = Long.valueOf(key);
						}
						method = constantClass.getMethod("getName", long.class);
					} else if (typeName.equals("char")) {
						args[0] = key;
						method = constantClass.getMethod("getName", char.class);
					} else {
						args[0] = key;
						method = constantClass.getMethod("getName", String.class);
					}
				}

				name = (String) method.invoke(constantClass, args);
			} catch (ClassNotFoundException e) {
				return null;
			} catch (Exception e) {
				e.printStackTrace();
			}
			return name;
		}
	}

	public static class IsDefault {
		public static final long DEFAULT = 1; // 默认

		public static final long NOTDEFAULT = 2; //

		public static final String getName(long lCode) {
			String strReturn = ""; // 初始化返回值
			switch ((int) lCode) {
			case (int) DEFAULT:
				strReturn = "默认";
				break;
			case (int) NOTDEFAULT:
				strReturn = "普通";
				break;
			}
			return strReturn;
		}
	}

	/**
	 * 菜单类型
	 *
	 * @author yoyo
	 *
	 */
	@SuppressWarnings("unused")
	public static class RequestMenuType {
		public static final long ADMIN = 2l;// 管理请求

		private static final String NAME_ADMIN = "管理请求";

		private static final String NAME_NORMAL = "普通请求";

		private static final String NAME_PUBLIC = "公共请求";

		public static final long NORMAL = 3l;// 普通请求

		public static final long PUBLIC = 1l;// 公共请求

		public static String getMode1JSONString(boolean all, boolean none) {
			BaseSelect baseSelect = SelectFactory.createBaseSelect();
			if (all) {
				baseSelect.addAllEmpty();
			}
			if (none) {
				baseSelect.addNoneEmpty();
			}
			baseSelect.addOption(PUBLIC, "公共请求");
			baseSelect.addOption(ADMIN, "管理请求");
			baseSelect.addOption(NORMAL, "普通请求");
			return baseSelect.getJSONSelectInfo();
		}

		public static final String getName(long lCode) {

			String strReturn = ""; // 初始化返回值
			switch ((int) lCode) {
			case (int) PUBLIC:
				strReturn = "公共请求";
				break;
			case (int) ADMIN:
				strReturn = "管理请求";
				break;
			case (int) NORMAL:
				strReturn = "普通请求";
				break;
			}
			return strReturn;
		}
	}

	public static class MQQUEUE {

		public static final String MQ_BANKCURDATA = "BANKCURDATA_QUEUE"; // 当日数据导入

		public static final String MQ_BANKCURTOHIS = "BANKCURTOHIS_QUEUE";// 当日数据转历史

		public static final String MQ_BANKDATACHECK = "BANKDATACHECK_QUEUE"; // 昨日数据核对

		public static final String MQ_MONITOR = "MONITOR_QUEUE";// 资金监控

		public static final String MQ_QUERYINSTRSTATUS = "QUERYINSTRSTATUS_QUEUE";// 指令状态同步

		public static final String MQ_SEND_SMS = "SEND_SMS_QUEUE";// 发送短信

		public static final String MQ_SENDEMAIL = "SENDEMAIL_QUEUE";// 发送邮件

		public static final String MQ_REPORT = "REPORT_QUEUE";// 报表队列

		public static final String MQ_AGREEMENTMANAGE = "AGREEMENTMANAGE_QUEUE";// 协议提醒
		
		public static final String MQ_JPUSH = "JPUSH_QUEUE";//消息推送
	}

	/**
	 * 新闻内容的状态
	 */
	public static class NewsBusinessstatus {
		public static final long APPROVAL = 2l;
		private static final String APPROVAL_NAME = "审核";
		public static final long DRAFT = 1l;
		private static final String DRAFT_NAME = "草稿";
		public static final long PUBLISHED = 3l;
		private static final String PUBLISHED_NAME = "已发布";

		public static String getModelJSONString(boolean all, boolean none) {
			BaseSelect baseSelect = SelectFactory.createBaseSelect();
			if (all) {
				baseSelect.addAllEmpty();
			}
			if (none) {
				baseSelect.addNoneEmpty();
			}
			baseSelect.addOption(DRAFT, DRAFT_NAME);
			// baseSelect.addOption(APPROVAL, APPROVAL_NAME);
			baseSelect.addOption(PUBLISHED, PUBLISHED_NAME);
			return baseSelect.getJSONSelectInfo();
		}

		public static String getName(long lCode) {
			String name = "";
			switch ((int) lCode) {
			case (int) DRAFT:
				name = DRAFT_NAME;
				break;
			case (int) APPROVAL:
				name = APPROVAL_NAME;
				break;
			case (int) PUBLISHED:
				name = PUBLISHED_NAME;
				break;
			}
			return name;
		}

	}

	/**
	 * 密码策略
	 */
	public static class PasswordPolicy {

		public static class Switch {
			public static final String OFF = "0"; // 不启用
			public static final String ON = "1"; // 启用
		}

		public static final String ACCOUNTLOCK = "accountlock";// 账户锁定
		public static final String ACCOUNTLOCK_LIMIT = "accountlock_limit";// 账户锁定
		public static final String LOWERCASE = "lowercase"; // 包含小写字母
		public static final String MINLENGTH = "minlength"; // 最小长度
		private static final String NAME_ACCOUNTLOCK = "账户锁定";

		private static final String NAME_ACCOUNTLOCK_LIMIT = "连续无效登陆操作次数无限制";
		private static final String NAME_LOWERCASE = "包含小写字母";
		private static final String NAME_MINLENGTH = "最小长度";
		private static final String NAME_NUMBER = "包含数字";
		private static final String NAME_PASSWORDCANNULL = "密码允许为空";
		private static final String NAME_PROMPTDAYS = "提示天数";
		private static final String NAME_PSWSAVEDAYS = "密码留存期";

		private static final String NAME_PSWSAVEDAYS_LIMIT = "密码留存期无限制";
		private static final String NAME_PWDHISTORY = "密码历史";
		private static final String NAME_SPECIALCHAR = "包含特殊字符";
		private static final String NAME_UPPERCASE = "包含大写字母";
		public static final String NUMBER = "number"; // 包含数字
		public static final String PASSWORDCANNULL = "passwordCanNull";// 账户锁定
		public static final String PROMPTDAYS = "promptDays";// 提示天数
		public static final String PSWSAVEDAYS = "pswSaveDays";// 密码留存期
		public static final String PSWSAVEDAYS_LIMIT = "pswSaveDays_limit";// 账户锁定
		public static final String PWDHISTORY = "pwdHistory";// 密码历史
		public static final String SPECIALCHAR = "specialchar"; // 包含特殊字符
		public static final String UPPERCASE = "uppercase"; // 包含大写字母

		public static String getName(String arg0) {
			String name = "";
			if (arg0.equals(MINLENGTH)) {
				name = NAME_MINLENGTH;
			} else if (arg0.equals(LOWERCASE)) {
				name = NAME_LOWERCASE;
			} else if (arg0.equals(UPPERCASE)) {
				name = NAME_UPPERCASE;
			} else if (arg0.equals(NUMBER)) {
				name = NAME_NUMBER;
			} else if (arg0.equals(SPECIALCHAR)) {
				name = NAME_SPECIALCHAR;
			} else if (arg0.equals(PSWSAVEDAYS)) {
				name = NAME_PSWSAVEDAYS;
			} else if (arg0.equals(PROMPTDAYS)) {
				name = NAME_PROMPTDAYS;
			} else if (arg0.equals(PWDHISTORY)) {
				name = NAME_PWDHISTORY;
			} else if (arg0.equals(ACCOUNTLOCK)) {
				name = NAME_ACCOUNTLOCK;
			} else if (arg0.equals(PASSWORDCANNULL)) {
				name = NAME_PASSWORDCANNULL;
			} else if (arg0.equals(PSWSAVEDAYS_LIMIT)) {
				name = NAME_PSWSAVEDAYS_LIMIT;
			} else if (arg0.equals(ACCOUNTLOCK_LIMIT)) {
				name = NAME_ACCOUNTLOCK_LIMIT;
			}
			return name;
		}
	}

	/**
	 * 是否按月收取 是否按笔收取
	 *
	 * @author issuser
	 *
	 */
	public static class ProposedOrMonth {
		public static final long No = 0;
		public static final long Yes = 1;

		public static final String getName(long lCode) {
			String strReturn = ""; // 初始化返回值
			switch ((int) lCode) {
			case (int) Yes:
				strReturn = "是";
				break;
			case (int) No:
				strReturn = "否";
				break;
			}
			return strReturn;
		}
	}

	public static class RecordStatus {
		public static final long INVALID = 0; // 无效

		public static final long VALID = 1; // 有效

		public static final String getName(long lCode) {
			String strReturn = ""; // 初始化返回值
			switch ((int) lCode) {
			case (int) INVALID:
				strReturn = "无效";
				break;
			case (int) VALID:
				strReturn = "有效";
				break;
			}
			return strReturn;
		}
	}

	/**
	 * 服务与菜单关联表中的数据状态
	 *
	 * @author jbren
	 *
	 */
	public static class ServiceMenuStatus {
		public static final long NEW = 0l; // 新数据

		public static final long OLD = 1l; // 旧数据
	}

	/**
	 * 商户登陆用户类型
	 *
	 * @author yoyo
	 *
	 */
	public static class StoreUserType {

		public static final long ADMIN = 2l; // 管理员

		public static final long NORMAL = 1l; // 普通用户

		public static final String getName(long lCode) {

			String strReturn = ""; // 初始化返回值
			switch ((int) lCode) {
			case (int) NORMAL:
				strReturn = "普通用户";
				break;
			case (int) ADMIN:
				strReturn = "管理员";
				break;
			}
			return strReturn;
		}

	}

	/*
	 * 系统自动任务状态(系统设置-自动任务设置模块，作为任务状态TASKSTATUS用)
	 */
	public static class TaskStatus {

		public static final long ACTIVATE = 2l; // 激活

		public static final long STOPUSING = 1l; // 停止

		public static final String getName(long lCode) {

			String strReturn = ""; // 初始化返回值
			switch ((int) lCode) {
			case (int) ACTIVATE:
				strReturn = "激活";
				break;
			case (int) STOPUSING:
				strReturn = "停止";
				break;
			}
			return strReturn;
		}

	}

	public static class YesOrNo {
		private static final String NAME_NO = "否";
		private static final String NAME_YES = "是";
		public static final long NO = 2; // 否
		// 是否
		public static final long YES = 1; // 是

		public static String getMode1JSONString(boolean all, boolean none) {
			BaseSelect baseSelect = SelectFactory.createBaseSelect();
			if (all) {
				baseSelect.addAllEmpty();
			}
			if (none) {
				baseSelect.addNoneEmpty();
			}
			baseSelect.addOption(YES, NAME_YES);
			baseSelect.addOption(NO, NAME_NO);
			return baseSelect.getJSONSelectInfo();
		}

		public static final String getName(long lCode) {
			String strReturn = ""; // 初始化返回值
			switch ((int) lCode) {
			case (int) YES:
				strReturn = NAME_YES;
				break;
			case (int) NO:
				strReturn = NAME_NO;
				break;
			}
			return strReturn;
		}
	}

	public static class MenuType {

		public static final long ADMIN = 1;// 管理菜单

		public static final long NORNAL = 2;// 普通菜单
	}

	/**
	 * 短信邮件模板类型
	 * 
	 * @author yubaode
	 *
	 */
	public static class Templatetype {
		/**
		 * 协议提醒
		 */
		public static final long AGREEMENTMANAGE = 1l;

		private static final String AGREEMENTMANAGE_NAME = "协议提醒";

		public static String getName(long iCode) {
			String name = "";
			switch ((int) iCode) {
			case (int) AGREEMENTMANAGE:
				name = AGREEMENTMANAGE_NAME;
				break;
			}
			return name;
		}

		/**
		 * @author HUANGYUAN
		 * @description 获得json数据
		 * @param all
		 * @param none
		 * @return String
		 * @时间 2015年10月10日 上午10:59:00
		 */
		public static String getModelJSONString(boolean all, boolean none) {
			BaseSelect baseSelect = SelectFactory.createBaseSelect();
			if (all) {
				baseSelect.addAllEmpty();
			}
			if (none) {
				baseSelect.addNoneEmpty();
			}
			baseSelect.addOption(AGREEMENTMANAGE, AGREEMENTMANAGE_NAME);
			return baseSelect.getJSONSelectInfo();
		}

		/**
		 * @author HUANGYUAN 获得短信设置的参数名称及对应的值
		 * @param value
		 * @return Map<String, Object>
		 * @时间 2015年10月10日 上午10:57:47
		 */
		public static final Map<String, Object> getParameterMap(String value) {
			Long code = Long.valueOf(value);
			Map<String, Object> parameterMap = new HashMap<String, Object>();
			if (code == AGREEMENTMANAGE) {
				parameterMap.put("${username}", "用户名称${username}");
				parameterMap.put("${agreementcode}", "协议编号${agreementcode}");
				parameterMap.put("${agreementname}", "协议名称${agreementname}");
				parameterMap.put("${exptime}", "协议到期日${exptime}");
			}
			return parameterMap;
		}

		/**
		 * @author HUANGYUAN
		 * @描述 获得变量的集合
		 * @param iCode
		 * @return
		 * @时间 2015年10月10日 上午10:58:18
		 */
		public static Set<String> getSmsSetParameter(String iCode) {
			Map<String, Object> parameterMap = getParameterMap(iCode);
			Set<String> sets = parameterMap.keySet();
			Set<String> paramSet = new HashSet<String>();
			for (String key : sets) {
				String keySet = key.substring(2, key.length() - 1);
				paramSet.add(keySet);
			}
			return paramSet;
		}

	}

	/**
	 * @author HUANGYUAN
	 * @description 短信发送状态
	 * @时间 2015年10月10日 下午5:27:46
	 */
	public static class Sendstatus {
		public static final long SUCCESS = 1L;
		public static final long FAIL = 2L;
		public static final long WAITING = 3L;

		private static final String SUCCESS_NAME = "发送成功";
		private static final String FAIL_NAME = "发送失败";
		private static final String WAITING_NAME = "草稿";

		public static String getModelJSONString(boolean all, boolean none) {
			BaseSelect baseSelect = SelectFactory.createBaseSelect();
			if (all) {
				baseSelect.addAllEmpty();
			}
			if (none) {
				baseSelect.addNoneEmpty();
			}
			baseSelect.addOption(SUCCESS, SUCCESS_NAME);
			baseSelect.addOption(FAIL, FAIL_NAME);
			baseSelect.addOption(WAITING, WAITING_NAME);
			return baseSelect.getJSONSelectInfo();
		}

		public static String getName(long iCode) {
			String name = "";
			switch ((int) iCode) {
			case (int) SUCCESS:
				name = SUCCESS_NAME;
				break;

			case (int) FAIL:
				name = FAIL_NAME;
				break;
			case (int) WAITING:
				name = WAITING_NAME;
				break;
			}
			return name;
		}
	}

	/**
	 * 邮件模板常量
	 * 
	 * @author huangyuan
	 *
	 */
	public static class TemplateEmailType {
		/**
		 * 协议提醒
		 */
		public static final long AGREEMENTMANAGE = 1l;
		public static final long APPROVALSTORE = 2l;
		public static final long RESETPASSWORD = 3l;

		private static final String AGREEMENTMANAGE_NAME = "协议提醒";
		private static final String APPROVALSTORE_NAME = "商户复核提醒";
		private static final String RESETPASSWORD_NAME = "重置密码提醒";

		public static String getName(long iCode) {
			String name = "";
			switch ((int) iCode) {
			case (int) AGREEMENTMANAGE:
				name = AGREEMENTMANAGE_NAME;
				break;
			case (int) APPROVALSTORE:
				name = APPROVALSTORE_NAME;
				break;
			case (int) RESETPASSWORD:
				name = RESETPASSWORD_NAME;
				break;
			}
			return name;
		}

		/**
		 * @author HUANGYUAN
		 * @description 获得json数据
		 * @param all
		 * @param none
		 * @return String
		 * @时间 2015年10月10日 上午10:59:00
		 */
		public static String getModelJSONString(boolean all, boolean none) {
			BaseSelect baseSelect = SelectFactory.createBaseSelect();
			if (all) {
				baseSelect.addAllEmpty();
			}
			if (none) {
				baseSelect.addNoneEmpty();
			}
			baseSelect.addOption(AGREEMENTMANAGE, AGREEMENTMANAGE_NAME);
			baseSelect.addOption(APPROVALSTORE, APPROVALSTORE_NAME);
			baseSelect.addOption(RESETPASSWORD, RESETPASSWORD_NAME);
			return baseSelect.getJSONSelectInfo();
		}

		/**
		 * @author HUANGYUAN 获得短信设置的参数名称及对应的值
		 * @param value
		 * @return Map<String, Object>
		 * @时间 2015年10月10日 上午10:57:47
		 */
		public static final Map<String, Object> getParameterMap(String value) {
			Long code = Long.valueOf(value);
			Map<String, Object> parameterMap = new HashMap<String, Object>();
			if (code == AGREEMENTMANAGE) {
				parameterMap.put("${username}", "用户名称${username}");
				parameterMap.put("${agreementcode}", "协议编号${agreementcode}");
				parameterMap.put("${agreementname}", "协议名称${agreementname}");
				parameterMap.put("${exptime}", "协议到期日${exptime}");
			} else if (code == APPROVALSTORE) {
				parameterMap.put("${storeName}", "商户名称${storeName}");
				parameterMap.put("${userInfo}", "用户信息${userInfo}");
			}
			return parameterMap;
		}

		/**
		 * @author HUANGYUAN
		 * @描述 获得变量的集合
		 * @param iCode
		 * @return
		 * @时间 2015年10月10日 上午10:58:18
		 */
		public static Set<String> getEmailSetParameter(String iCode) {
			Map<String, Object> parameterMap = getParameterMap(iCode);
			Set<String> sets = parameterMap.keySet();
			Set<String> paramSet = new HashSet<String>();
			for (String key : sets) {
				String keySet = key.substring(2, key.length() - 1);
				paramSet.add(keySet);
			}
			return paramSet;
		}
	}

	public static class ParameterType {
		public static final long INPUT = 1; // 输入型
		private static final String INPUT_NAME = "输入型";
		public static final long SELECT = 0; // 选择型
		private static final String SELECT_NAME = "选择型";

		public static final String getName(long lCode) {
			String strReturn = ""; // 初始化返回值
			switch ((int) lCode) {
			case (int) INPUT:
				strReturn = INPUT_NAME;
				break;
			case (int) SELECT:
				strReturn = SELECT_NAME;
				break;
			}
			return strReturn;
		}

		public static String getModelJSONString(boolean all, boolean none) {
			BaseSelect baseSelect = SelectFactory.createBaseSelect();
			if (all) {
				baseSelect.addAllEmpty();
			}
			if (none) {
				baseSelect.addNoneEmpty();
			}
			baseSelect.addOption(INPUT, INPUT_NAME);
			baseSelect.addOption(SELECT, SELECT_NAME);
			return baseSelect.getJSONSelectInfo();
		}
	}

	/**
	 * 商户注册的信息来源
	 * 
	 * @author HuangYuan
	 *
	 */
	public static class StoreSources {
		public static final long MANAGER = 1l;
		public static final long STORE = 2l;
		private static final String MANAGER_NAME = "系统运营端";
		private static final String STORE_NAME = "系统运营端";

		public static String getName(long lCode) {
			String name = "";
			if (MANAGER == lCode) {
				name = MANAGER_NAME;
			} else if (STORE == lCode) {
				name = STORE_NAME;
			}
			return name;
		}

		public static String getModelJSONString(boolean all, boolean none) {
			BaseSelect baseSelect = SelectFactory.createBaseSelect();
			if (all) {
				baseSelect.addAllEmpty();
			}
			if (none) {
				baseSelect.addNoneEmpty();
			}
			baseSelect.addOption(MANAGER, MANAGER_NAME);
			baseSelect.addOption(STORE, STORE_NAME);
			return baseSelect.getJSONSelectInfo();
		}
	}

	/****************
	 * 商户 短信开关
	 * 
	 * @author yubaode
	 */
	public static class isMessageSwitch {
		public static final long YES = 1;
		public static final long NO = 2;

		private static final String YES_NAME = "是";
		private static final String NO_NAME = "否";

		public static final String getName(long lCode) {
			String strReturn = ""; // 初始化返回值
			switch ((int) lCode) {
			case (int) YES:
				strReturn = YES_NAME;
				break;
			case (int) NO:
				strReturn = NO_NAME;
				break;
			}
			return strReturn;
		}
	}

	/****************
	 * 商户 短信开关
	 * 
	 * @author yubaode
	 */
	public static class MessageSwitchType {
		public static final long LOGIN_SWITCH = 1; // 登录短信
		public static final long INSTRUCTION_SWITCH = 2; // 指令发送短信
		public static final long AGREENT_SWITCH = 3; // 协议短信
		public static final long SERVICE_SWITCH = 4; // 服务短信

		private static final String LOGIN_SWITCH_NAME = "登录短信";
		private static final String INSTRUCTION_SWITCH_NAME = "指令发送";
		public static final String AGREENT_SWITCH_NAME = "协议提醒"; // 协议短信
		public static final String SERVICE_SWITCH_NAME = "服务短信"; // 服务短信

		public static final String getName(long lCode) {
			String strReturn = ""; // 初始化返回值
			switch ((int) lCode) {
			case (int) LOGIN_SWITCH:
				strReturn = LOGIN_SWITCH_NAME;
				break;
			case (int) INSTRUCTION_SWITCH:
				strReturn = INSTRUCTION_SWITCH_NAME;
				break;
			case (int) AGREENT_SWITCH:
				strReturn = AGREENT_SWITCH_NAME;
				break;
			case (int) SERVICE_SWITCH:
				strReturn = SERVICE_SWITCH_NAME;
				break;
			}
			return strReturn;
		}

		public static String getModelJSONString(boolean all, boolean none) {
			BaseSelect baseSelect = SelectFactory.createBaseSelect();
			if (all) {
				baseSelect.addAllEmpty();
			}
			if (none) {
				baseSelect.addNoneEmpty();
			}
			baseSelect.addOption(LOGIN_SWITCH, LOGIN_SWITCH_NAME);
			baseSelect.addOption(INSTRUCTION_SWITCH, INSTRUCTION_SWITCH_NAME);
			return baseSelect.getJSONSelectInfo();
		}

		public static String getModelForCheckBox() {
			BaseSelect baseSelect = SelectFactory.createBaseSelect();
			baseSelect.addOption(LOGIN_SWITCH, LOGIN_SWITCH_NAME);
			baseSelect.addOption(INSTRUCTION_SWITCH, INSTRUCTION_SWITCH_NAME);
			baseSelect.addOption(AGREENT_SWITCH, AGREENT_SWITCH_NAME);
			baseSelect.addOption(SERVICE_SWITCH, SERVICE_SWITCH_NAME);
			return baseSelect.getJSONSelectInfo();
		}
	}

	public static class ServiceBuyType {
		public static final long STORE_BUY = 1; // 商户购买
		public static final long OTHER_BUY = 2; // 代购
	}

	public static class ServiceBuyUsestatus {
		public static final long VALID_BUY = 1; // 正常
		public static final long REFUND_BUY = 2; // 退款
		public static final String VALID_BUY_NAME = "正常"; // 正常
		public static final String REFUND_BUY_NAME = "退款"; // 退款

		public static final String getName(long lCode) {
			String strReturn = ""; // 初始化返回值
			switch ((int) lCode) {
			case (int) VALID_BUY:
				strReturn = VALID_BUY_NAME;
				break;
			case (int) REFUND_BUY:
				strReturn = REFUND_BUY_NAME;
				break;
			}
			return strReturn;
		}
	}
	
	/**
	 * 用户优惠码：优惠类型(ExchangeTimes,ExchangePermission_TL,MoneyDiscount,PaymentAmount)
	 * @ClassName: PreferentialType  
	 * @author Green.Long
	 * @date 2016年8月23日 下午5:10:10
	 */
	public static class PreferentialType {
		public static final String EXCHANGETIMES = "ExchangeTimes";
		public static final String EXCHANGEPERMISSION_TL = "ExchangePermission_TL";
		public static final String MONEYDISCOUNT = "MoneyDiscount";
		public static final String PAYMENTAMOUNT = "PaymentAmount";
		
		private static final String EXCHANGETIMES_NAME = "兑换时长";
		private static final String EXCHANGEPERMISSION_TL_NAME = "兑换包天套餐";
		private static final String MONEYDISCOUNT_NAME = "支付折扣";
		private static final String PAYMENTAMOUNT_NAME = "指定付款金额";
		
		private static final int EXCHANGETIMES_LONG = 2;
		private static final int EXCHANGEPERMISSION_TL_LONG = 3;
		private static final int MONEYDISCOUNT_LONG = 5;
		private static final int PAYMENTAMOUNT_LONG = 7;

		public static String getName(String lCode) {
			String name = "";
			if (EXCHANGETIMES.equals(lCode)) {
				name = EXCHANGETIMES_NAME;
			} else if (EXCHANGEPERMISSION_TL.equals(lCode)) {
				name = EXCHANGEPERMISSION_TL_NAME;
			} else if (MONEYDISCOUNT.equals(lCode)) {
				name = MONEYDISCOUNT_NAME;
			} else if (PAYMENTAMOUNT.equals(lCode)) {
				name = PAYMENTAMOUNT_NAME;
			} 
			return name;
		}
		
		public static int getLongName(String lCode) {
			int name = 0;
			if (EXCHANGETIMES.equals(lCode)) {
				name = EXCHANGETIMES_LONG;
			} else if (EXCHANGEPERMISSION_TL.equals(lCode)) {
				name = EXCHANGEPERMISSION_TL_LONG;
			} else if (MONEYDISCOUNT.equals(lCode)) {
				name = MONEYDISCOUNT_LONG;
			} else if (PAYMENTAMOUNT.equals(lCode)) {
				name = PAYMENTAMOUNT_LONG;
			} 
			return name;
		}
		

		public static String getModelJSONString(boolean all, boolean none) {
			BaseSelect baseSelect = SelectFactory.createBaseSelect();
			if (all) {
				baseSelect.addAllEmpty();
			}
			if (none) {
				baseSelect.addSelectEmpty();
			}
			baseSelect.addOption(EXCHANGETIMES, EXCHANGETIMES_NAME);
			baseSelect.addOption(EXCHANGEPERMISSION_TL, EXCHANGEPERMISSION_TL_NAME);
			baseSelect.addOption(MONEYDISCOUNT, MONEYDISCOUNT_NAME);
			baseSelect.addOption(PAYMENTAMOUNT, PAYMENTAMOUNT_NAME);
			return baseSelect.getJSONSelectInfo();
		}
		
		public static String getModelJSONString2(boolean all, boolean none) {
			BaseSelect baseSelect = SelectFactory.createBaseSelect();
			if (all) {
				baseSelect.addAllEmpty();
			}
			if (none) {
				baseSelect.addSelectEmpty();
			}
			baseSelect.addOption(EXCHANGETIMES, EXCHANGETIMES_NAME);
			baseSelect.addOption(EXCHANGEPERMISSION_TL, EXCHANGEPERMISSION_TL_NAME);
			return baseSelect.getJSONSelectInfo();
		}
	}
	
	
	/**
	 * TE的数据状态
	 * @ClassName: TEDataStatus  
	 * @author Green.Long
	 * @date 2016年8月25日 下午6:40:58
	 */
	public static class TEDataStatus {
		public static final String INUSE = "InUse";
		public static final String BLOCKUP = "BlockUp";
		
		private static final String INUSE_NAME = "启用";
		private static final String BLOCKUP_NAME = "停用";


		public static String getName(String lCode) {
			String name = "";
			if (INUSE.equals(lCode)) {
				name = INUSE_NAME;
			} else if (BLOCKUP.equals(lCode)) {
				name = BLOCKUP_NAME;
			} 
			return name;
		}

		public static String getModelJSONString(boolean all, boolean none) {
			BaseSelect baseSelect = SelectFactory.createBaseSelect();
			if (all) {
				baseSelect.addAllEmpty();
			}
			if (none) {
				baseSelect.addSelectEmpty();
			}
			baseSelect.addOption(INUSE, INUSE_NAME);
			baseSelect.addOption(BLOCKUP, BLOCKUP_NAME);
			return baseSelect.getJSONSelectInfo();
		}
		
	}
	/**
	 * 译员类型
	 * @ClassName: TranslatorType  
	 * @author Green.Long
	 * @date 2016年8月25日 下午6:42:00
	 */
	public static class TranslatorType {
		public static final String FULLTIME = "FULL_TIME";
		public static final String PARTTIME = "PART_TIME";
		
		private static final String FULLTIME_NAME = "全职";
		private static final String PARTTIME_NAME = "兼职";


		public static String getName(String lCode) {
			String name = "";
			if (FULLTIME.equals(lCode)) {
				name = FULLTIME_NAME;
			} else if (PARTTIME.equals(lCode)) {
				name = PARTTIME_NAME;
			} 
			return name;
		}

		public static String getModelJSONString(boolean all, boolean none) {
			BaseSelect baseSelect = SelectFactory.createBaseSelect();
			if (all) {
				baseSelect.addAllEmpty();
			}
			if (none) {
				baseSelect.addSelectEmpty();
			}
			baseSelect.addOption(FULLTIME, FULLTIME_NAME);
			baseSelect.addOption(PARTTIME, PARTTIME_NAME);
			return baseSelect.getJSONSelectInfo();
		}
		
	}
	/**
	 * 支付方式
	 * @ClassName: PaymentType  
	 * @author Green.Long
	 * @date 2016年8月26日 下午4:59:36
	 */
	public static class PaymentType {
		public static final String ALIPAY = "AliPay";
		public static final String WEIXINPAY = "WeiXinPay";
		public static final String PAYPAL = "PayPal";
		public static final String APPLEPAL = "ApplePal";
		public static final String SYSTEMAUTO = "SystemAuto";
		
		private static final String ALIPAY_NAME = "支付宝";
		private static final String WEIXINPAY_NAME = "微信";
		private static final String PAYPAL_NAME = "贝宝";
		private static final String APPLEPAL_NAME = "苹果";
		private static final String SYSTEMAUTO_NAME = "系统";


		public static String getName(String lCode) {
			String name = "";
			if (ALIPAY.equals(lCode)) {
				name = ALIPAY_NAME;
			} else if (WEIXINPAY.equals(lCode)) {
				name = WEIXINPAY_NAME;
			} else if (PAYPAL.equals(lCode)) {
				name = PAYPAL_NAME;
			} else if (APPLEPAL.equals(lCode)) {
				name = APPLEPAL_NAME;
			} else if (SYSTEMAUTO.equals(lCode)) {
				name = SYSTEMAUTO_NAME;
			} 
			return name;
		}

		public static String getModelJSONString(boolean all, boolean none) {
			BaseSelect baseSelect = SelectFactory.createBaseSelect();
			if (all) {
				baseSelect.addAllEmpty();
			}
			if (none) {
				baseSelect.addSelectEmpty();
			}
			baseSelect.addOption(ALIPAY, ALIPAY_NAME);
			baseSelect.addOption(WEIXINPAY, WEIXINPAY_NAME);
			baseSelect.addOption(PAYPAL, PAYPAL_NAME);
			baseSelect.addOption(APPLEPAL, APPLEPAL_NAME);
			baseSelect.addOption(SYSTEMAUTO, SYSTEMAUTO_NAME);
			return baseSelect.getJSONSelectInfo();
		}
		
	}
	/**
	 * 支付币种
	 * @ClassName: TranslatorType  
	 * @author Green.Long
	 * @date 2016年8月26日 下午5:05:52
	 */
	public static class CurrencyType {
		public static final String CNY = "CNY";
		public static final String USD = "USD";
		
		private static final String CNY_NAME = "人名币";
		private static final String USD_NAME = "美元";


		public static String getName(String lCode) {
			String name = "";
			if (CNY.equals(lCode)) {
				name = CNY_NAME;
			} else if (USD.equals(lCode)) {
				name = USD_NAME;
			} 
			return name;
		}

		public static String getModelJSONString(boolean all, boolean none) {
			BaseSelect baseSelect = SelectFactory.createBaseSelect();
			if (all) {
				baseSelect.addAllEmpty();
			}
			if (none) {
				baseSelect.addSelectEmpty();
			}
			baseSelect.addOption(CNY, CNY_NAME);
			baseSelect.addOption(USD, USD_NAME);
			return baseSelect.getJSONSelectInfo();
		}
		
	}
}